From 91336be9b3d145c0b7a0250f953d980c1dea9061 Mon Sep 17 00:00:00 2001 From: Dom Lachowicz Date: Fri, 3 Mar 2006 03:32:39 +0000 Subject: [PATCH] Fix combobox theming regression noted in bug 321301 Ditto * modules/engines/ms-windows/msw_style.c: Fix combobox theming regression noted in bug 321301 * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Ditto --- ChangeLog | 6 +++ ChangeLog.pre-2-10 | 6 +++ .../engines/ms-windows/Theme/gtk-2.0/gtkrc | 13 ------- modules/engines/ms-windows/msw_style.c | 37 ++++++++++++++----- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f61228faa..6f808f240b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-02 Dom Lachowicz + + * modules/engines/ms-windows/msw_style.c: Fix combobox theming + regression noted in bug 321301 + * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Ditto + 2006-03-02 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_layout) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5f61228faa..6f808f240b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2006-03-02 Dom Lachowicz + + * modules/engines/ms-windows/msw_style.c: Fix combobox theming + regression noted in bug 321301 + * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Ditto + 2006-03-02 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_layout) diff --git a/modules/engines/ms-windows/Theme/gtk-2.0/gtkrc b/modules/engines/ms-windows/Theme/gtk-2.0/gtkrc index 92c8b4b038..d71c9d833b 100755 --- a/modules/engines/ms-windows/Theme/gtk-2.0/gtkrc +++ b/modules/engines/ms-windows/Theme/gtk-2.0/gtkrc @@ -38,16 +38,3 @@ style "msw-default" } class "*" style "msw-default" -style "msw-combobox-toggle" = "msw-default" -{ - xthickness = 0 - ythickness = 0 - GtkButton::default-border = { 0, 0, 0, 0 } - GtkButton::default-outside-border = { 0, 0, 0, 0 } - GtkButton::child-displacement-x = 0 - GtkButton::child-displacement-y = 0 - GtkWidget::focus-padding = 0 - GtkWidget::focus-line-width = 0 -} -widget_class "*ComboBox*ToggleButton*" style "msw-combobox-toggle" - diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index 740255e16f..10a9f18e12 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -804,6 +804,23 @@ setup_msw_rc_style (void) "}widget_class \"*CheckButton*\" style \"msw-checkbutton\"\n" "widget_class \"*RadioButton*\" style \"msw-checkbutton\"\n"); gtk_rc_parse_string (buf); + + if(xp_theme_is_active()) { + g_snprintf (buf, sizeof(buf), + "style \"msw-combobox-toggle\" = \"msw-default\"\n" + "{\n" + "xthickness = 0\n" + "ythickness = 0\n" + "GtkButton::default-border = { 0, 0, 0, 0 }\n" + "GtkButton::default-outside-border = { 0, 0, 0, 0 }\n" + "GtkButton::child-displacement-x = 0\n" + "GtkButton::child-displacement-y = 0\n" + "GtkWidget::focus-padding = 0\n" + "GtkWidget::focus-line-width = 0\n" + "}\n" + "widget_class \"*ComboBox*ToggleButton*\" style \"msw-combobox-toggle\"\n"); + gtk_rc_parse_string (buf); + } } static void @@ -926,7 +943,7 @@ static gboolean is_combo_box_child (GtkWidget* w) { GtkWidget* tmp; - + if (w == NULL) return FALSE; @@ -947,7 +964,7 @@ combo_box_draw_arrow (GtkStyle * style, GtkWidget * widget) { if (xp_theme_draw (window, XP_THEME_ELEMENT_COMBOBUTTON, - style, widget->allocation.x, widget->allocation.y, + style, widget->allocation.x, widget->allocation.y, widget->allocation.width, widget->allocation.height, state, area)) { @@ -973,7 +990,7 @@ combo_box_draw_box (GtkStyle * style, { GtkWidget* combo_box; GdkRectangle combo_alloc; - + if (!widget) return FALSE; for (combo_box = widget->parent; combo_box; combo_box = combo_box->parent) @@ -985,10 +1002,10 @@ combo_box_draw_box (GtkStyle * style, return FALSE; combo_alloc = combo_box->allocation; - if (window != combo_box->window) + if (window != combo_box->window) { GtkWidget* tmp; - for (tmp = widget; tmp && tmp != combo_box; tmp = widget->parent) + for (tmp = widget; tmp && tmp != combo_box; tmp = widget->parent) { if (tmp->parent && tmp->window != tmp->parent->window) { @@ -997,10 +1014,10 @@ combo_box_draw_box (GtkStyle * style, } } } - + if (xp_theme_draw (window, XP_THEME_ELEMENT_EDIT_TEXT, style, combo_alloc.x, combo_alloc.y, - combo_alloc.width, combo_alloc.height, + combo_alloc.width, combo_alloc.height, state_type, area)) return TRUE; @@ -1584,7 +1601,7 @@ draw_box (GtkStyle * style, GtkWidget * widget, const gchar * detail, gint x, gint y, gint width, gint height) { - if (is_combo_box_child (widget) + if (is_combo_box_child (widget) && combo_box_draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height)) { @@ -1835,7 +1852,7 @@ draw_box (GtkStyle * style, { return; } - } + } else if (detail && (strcmp (detail, "vscrollbar") == 0 || strcmp (detail, "hscrollbar") == 0)) @@ -2163,7 +2180,7 @@ draw_shadow (GtkStyle * style, { gboolean is_handlebox_grippie = (detail && !strcmp (detail, "handlebox")); - if (is_combo_box_child (widget) + if (is_combo_box_child (widget) && combo_box_draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height)) { -- 2.30.2